package desmontec.aluguel.dto;

import java.text.DecimalFormat;
import java.util.List;

import desmontec.aluguel.ConsumoAluguel;
import desmontec.util.Constantes;

public class DetalhesConsumoDTO {

	private Double totalHoras;
	private Double totalGasto;
	private Double mediaHoras;
	private Double mediaValorGasto;
	
	private Double totalConsumoDiesel;
	private Double totalConsumoOleo40;
	private Double totalConsumoOleo68;
	private Double totalConsumoOleo90;
	private Double totalConsumoGraxas;
	
	public DetalhesConsumoDTO() {
		 totalHoras = 0.0;
		 totalGasto = 0.0;
		 totalConsumoDiesel = 0.0;
		 totalConsumoOleo40 = 0.0;
		 totalConsumoOleo68 = 0.0;
		 totalConsumoOleo90 = 0.0;
		 totalConsumoGraxas = 0.0;
		 mediaHoras = 0.0;
		 mediaValorGasto = 0.0;
		
	}
	
	public Double getTotalGasto(){
		return totalGasto;
	}
	
	public Double getTotalHoras() {
		return totalHoras;
	}
	public Double getTotalConsumoDiesel() {
		return totalConsumoDiesel;
	}
	public Double getTotalConsumoOleo40() {
		return totalConsumoOleo40;
	}
	public Double getTotalConsumoOleo68() {
		return totalConsumoOleo68;
	}
	public Double getTotalConsumoOleo90() {
		return totalConsumoOleo90;
	}
	public Double getTotalConsumoGraxas() {
		return totalConsumoGraxas;
	}	
	
	public void incHoras(Double valor) {
		 totalHoras += valor;
	}
	public void incConsumoDiesel(Double valor) {
		totalConsumoDiesel += valor;;
	}
	public void incConsumoOleo40(Double valor) {
		totalConsumoOleo40 += valor;;
	}
	public void incConsumoOleo68(Double valor) {
		totalConsumoOleo68 += valor;;
	}
	public void incConsumoOleo90(Double valor) {
		totalConsumoOleo90 += valor;;
	}
	public void incConsumoGraxas(Double valor) {
		totalConsumoGraxas += valor;;
	}	
	public void incTotalGasto(Double valor){
		totalGasto += valor;
	}

	public Double getMediaHoras() {
		return mediaHoras;
	}

	public Double getMediaValorGasto() {
		return mediaValorGasto;
	}
	
	
	
	public void setMedias(int quantidadeDias){
		DecimalFormat twoDForm = new DecimalFormat("#.##");
		mediaHoras = Double.valueOf(twoDForm.format(totalHoras / quantidadeDias));
		mediaValorGasto = Double.valueOf(twoDForm.format(totalGasto / quantidadeDias));
	}
		
	
}
